﻿<UserControl x:Class="SPIWareMVVM.Views.DeliveryList"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             xmlns:me="clr-namespace:SPIWareMVVM.ViewModels" 
             xmlns:views="clr-namespace:SPIWareMVVM.Views"
             xmlns:ctrl="clr-namespace:System.Windows.Controls;assembly=PresentationFramework"
             mc:Ignorable="d" 
             d:DesignHeight="300" d:DesignWidth="300">
    <UserControl.Resources>
        <ObjectDataProvider x:Key="applicationData" ObjectType="{x:Type me:ApplicationData}"/>
    </UserControl.Resources>
    <DockPanel>
        <ToolBar DockPanel.Dock="Top">
            <TextBlock DockPanel.Dock="Top" Text="Shipment / Deliveries" Background="Azure" Width="Auto"/>
            <Separator/>
        </ToolBar>

        <ListBox DockPanel.Dock="Left" x:Name="lbDelivery" ItemsSource="{Binding Path=AllDeliveries, Source={StaticResource applicationData}, Mode=TwoWay}"
                 SelectionChanged="Delivery_SelectionChanged"/>
        <DockPanel x:Name="dpDeliveryEdit" DockPanel.Dock="Top" Visibility="Collapsed">
            <StackPanel DockPanel.Dock="Top" Orientation="Horizontal">
                <TextBlock Text="("/>
                <TextBlock Text="{Binding Path=SelectedItem.WorkOrderId, ElementName=lbDelivery}"/>
                <TextBlock Text=") "/>
                <TextBlock Text="{Binding Path=SelectedItem.Quantity, ElementName=lbDelivery}"/>
                <TextBlock Text=" "/>
                <TextBlock Text="{Binding Path=SelectedItem.Part.Description, ElementName=lbDelivery}"/>
            </StackPanel>
            <ToolBar DockPanel.Dock="Left" Background="MidnightBlue"/>
            <Grid DockPanel.Dock="Top">
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="85"/>
                    <ColumnDefinition Width="Auto"/>
                </Grid.ColumnDefinitions>
                <Grid.RowDefinitions>
                    <RowDefinition Height="Auto"/>
                </Grid.RowDefinitions>
            </Grid>
        </DockPanel>
    </DockPanel>
</UserControl>
